package data.obj;



import java.util.LinkedList;

public enum CcrCfg_RiskFactor_Type
{
	FX,
	IR,
	EQ,
	CO,
	CR,
	HR,
	IF,
	VI,	// Implied Vilatility for IRs
	VF,	// Implied Volatility for FXs
	VX,	// Implied Volatility for EQs and COs
	RR,	// RecoveryRate
	CP,	// Coupon
	CalibVolProc;	// Calibration volatility
	
	// Skips HR,CalibVolProc CP, Calib
	public static CcrCfg_RiskFactor_Type[] valuesForGui()
	{
		LinkedList<CcrCfg_RiskFactor_Type> list = new LinkedList<CcrCfg_RiskFactor_Type>();
		for (CcrCfg_RiskFactor_Type t : values())
		{
			if (HR.equals(t) || RR.equals(t) || CP.equals(t) || CalibVolProc.equals(t))
				continue;
			
			list.add(t);
		}
		
		return list.toArray(new CcrCfg_RiskFactor_Type[list.size()]);
	}
	
	// Skips HR, RR, CP
	public static CcrCfg_RiskFactor_Type[] valuesForStresstestGui()
	{
		LinkedList<CcrCfg_RiskFactor_Type> list = new LinkedList<CcrCfg_RiskFactor_Type>();
		for (CcrCfg_RiskFactor_Type t : values())
		{
			if (HR.equals(t) || RR.equals(t) || CP.equals(t))
				continue;
			
			list.add(t);
		}
		
		return list.toArray(new CcrCfg_RiskFactor_Type[list.size()]);
	}
	
	public static String[] asNames(CcrCfg_RiskFactor_Type[] types)
	{
		String[] names = new String[types.length];
		for (int i = 0; i < types.length; i++)
			names[i] = types[i].name();
		return names;
	}

}
